package routePlanner.entities;

public class CityConnection {

	private Integer id;
	private City startCity;
	private City endCity;
	private Vehicle vehicle;
	private double avgSpeed;

	public CityConnection(Integer id, City startCity, City endCity,
			Vehicle vehicle, double avgSpeed) {

		this.id = id;
		this.startCity = startCity;
		this.endCity = endCity;
		this.vehicle = vehicle;
		this.avgSpeed = avgSpeed;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getId() {
		return id;
	}

	public City getStartCity() {
		return startCity;
	}

	public City getEndCity() {
		return endCity;
	}

	public Vehicle getVehicle() {
		return vehicle;
	}

	public double getAvgSpeed() {
		return avgSpeed;
	}

  public long getDistance() {
    long minLongitude = endCity.getLongitude() - startCity.getLongitude();
		long minLatitude = endCity.getLatitude() - startCity.getLatitude();
		long distance = minLongitude^2 + minLatitude^2;
		
		return distance;
  }
}
